﻿Public Class trayicon
    Private Sub trayicon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Hide()
        Me.NotifyIcon1.Icon = Me.Icon
        Me.NotifyIcon1.Text = "MChat Notifications"
    End Sub
    Public Sub ShowTip(ByVal Icontype As String, ByVal Msg As String, ByVal Title As String)
        Select Case Icontype
            Case "error"
                Me.NotifyIcon1.BalloonTipIcon = Windows.Forms.ToolTipIcon.Error
            Case "warn"
                Me.NotifyIcon1.BalloonTipIcon = Windows.Forms.ToolTipIcon.Warning
            Case "info"
                Me.NotifyIcon1.BalloonTipIcon = Windows.Forms.ToolTipIcon.Info
            Case Else
                Me.NotifyIcon1.BalloonTipIcon = Windows.Forms.ToolTipIcon.None
        End Select
        Me.NotifyIcon1.BalloonTipText = Msg
        Me.NotifyIcon1.BalloonTipTitle = Title
        Me.NotifyIcon1.ShowBalloonTip(10000)
    End Sub
End Class